package com.someclip.component.controlls
{
	import com.someclip.component.core.Component;
	import com.someclip.component.interfaces.IComponent;

	import flash.display.DisplayObject;
	import flash.display.SimpleButton;
	import com.someclip.component.skins.DefaultButtonSkin;

	public class BaseButton extends Component implements IComponent
	{
		private var _buttonRef:SimpleButtonExtend;

		public function BaseButton()
		{
			super();
			var defaultSkin:DefaultButtonSkin=new DefaultButtonSkin();
			_buttonRef=new SimpleButtonExtend(defaultSkin.upState, defaultSkin.overState, defaultSkin.downState, defaultSkin.hitTestState);
			defaultSkin=null;
			this.styleLink=_buttonRef;
		}

		override public function set styleLink(value:Object):void
		{
			if (value is SimpleButton)
			{
				_buttonRef.upState=(value as SimpleButton).upState;
				_buttonRef.overState=(value as SimpleButton).overState;
				_buttonRef.downState=(value as SimpleButton).downState;
				_buttonRef.hitTestState=(value as SimpleButton).hitTestState;
				super.styleLink=_buttonRef;
			}
			else
			{
				super.styleLink=value;
			}
		}
	}
}
